package main

import "fmt"

type Person struct {
	name string //名字
	sex  byte   //性别
	age  int    //年龄
}

type Student struct {
	Person //只有类型，没有名字，匿名字段，继承了Person的成员
	id     int
	addr   string
}

func main() {

	s1 := Student{Person{"mike", 'f', 23}, 2, "xa"}
	fmt.Println(" 01 - stu = ", s1)
	s1.name = "yoyo"
	s1.sex = 'f'
	s1.age = 22
	s1.addr = "sz"
	fmt.Println(" 02 - stu = ", s1)

	s1.Person = Person{"go", 'm', 18}
	fmt.Println(" 03 - stu = ", s1)

}
